
#pragma once

namespace reload
{
	class ReloadOverlay;

	class ReloadDebugMgr : public asyframe::HandlerBase, public virtual asyframe::IUdpAction
	{
	public:
		ReloadDebugMgr(boost::weak_ptr<ReloadOverlay> _pReloadOverlay);
		virtual ~ReloadDebugMgr();

		virtual retT init();
		virtual retT start();

		retT readOneCmd();

		retT onReadCmd( boost::shared_ptr<asyframe::UdpHandlerContext> _pUdpHandlerContext, std::size_t _bytesTransferred, const boost::system::error_code& e, std::size_t _timeoutCount);
		retT processCmd(int _cmd, boost::shared_ptr<boost::asio::ip::udp::endpoint> _pRemoteEndpoint);

		retT responseChordInfo(boost::shared_ptr<boost::asio::ip::udp::endpoint> _pRemoteEndpoint);

		retT responseDataStorageInfo(boost::shared_ptr<boost::asio::ip::udp::endpoint> _pRemoteEndpoint);

	protected:
		boost::weak_ptr<ReloadOverlay> pReloadOverlay_;
		boost::shared_ptr<asyframe::UdpHandler> pUdpHandler_;
	};
}
